/**
 * Licensed to Open-Ones Group under one or more contributor license
 * agreements. See the NOTICE file distributed with this work
 * for additional information regarding copyright ownership.
 * Open-Ones Group licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a
 * copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package mks.webshop.entity;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Text;

/**
 * @author thachle
 */
@PersistenceCapable
public class Product extends BaseEntity implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/** Physical primary key of the object. */
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long key;

    /** Barcode/Identifier of the category. */
    @Persistent
    private String id;

    /** Sequence order. */
    @Persistent
    private int order;

    @Persistent
    private String lang;
    
    @Persistent
    private int isSpecial;
    
    /**
     * Name of the tab. This name is the key of displayed title.
     */
    @Persistent
    private String name;

    /** Rich-text content of the module/tab. */
    @Persistent
    private Text description;
    
    public Text getDescription() {
		return description;
	}

	public void setDescription(Text description) {
		this.description = description;
	}

	@Persistent
    private Date created;

    @Persistent
    private String createdBy;

    @Persistent
    private Date lastModified;

    @Persistent
    private String lastModifiedBy;
    
    @Persistent
    private String catId;
    
    @Persistent
    private Long price;
    
    public Long getPrice() {
		return price;
	}

	public void setPrice(Long price) {
		this.price = price;
	}
	
	@Persistent
	private int quantity;
	
	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	@Persistent
    private Long newPrice;
	
	@Persistent
	private String unit;

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	/**. urlImage */
    @Persistent
    private String imageKey;
    
    public String getImageKey(){
        return imageKey;
    }

    public void setImageKey(String imageKey){
        this.imageKey = imageKey;
    }
    
    
    @Persistent
    private String info;
    
    
    public String getInfo() {
		return info;
	}

	public void setInfo(String info) {
		this.info = info;
	}

	/**
     * Get the key of object.
     * @return Long
     */
    public Long getKey() {
        return key;
    }

    /**
     * Set the key for object.
     * @param key Long
     */
    public void setKey(Long key) {
        this.key = key;
    }

    /**
     * Get value of id.
     * @return the id
     */
    public String getId() {
        return id;
    }

    /**
     * Set the value for id.
     * @param id the id to set
     */
    public void setId(String id) {
        this.id = id;
    }
    
    /**
     * Get value of catId.
     * @return the catId
     */
    public String getCatId() {
        return catId;
    }

    /**
     * Set the value for catId.
     * @param catId the catId to set
     */
    public void setCatId(String catId) {
        this.catId = catId;
    }

    /**
     * Get value of lang.
     * @return the lang
     */
    public String getLang() {
        return lang;
    }

    /**
     * Set the value for lang.
     * @param lang the lang to set
     */
    public void setLang(String lang) {
        this.lang = lang;
    }

    /**
     * Get value of name.
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * Set the value for name.
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public Date getCreated() {
        return created;
    }

    @Override
    public void setCreated(Date created) {
        this.created = created;
    }

    @Override
    public String getCreatedBy() {
        return createdBy;
    }

    @Override
    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    @Override
    public Date getLastModified() {
        return lastModified;
    }

    @Override
    public void setLastModified(Date lastModified) {
        this.lastModified = lastModified;
    }

    @Override
    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    @Override
    public void setLastModifiedBy(String lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

	public Long getNewPrice() {
		return newPrice;
	}

	public void setNewPrice(Long newPrice) {
		this.newPrice = newPrice;
	}

	public int getIsSpecial() {
		return isSpecial;
	}

	public void setIsSpecial(int isSpecial) {
		this.isSpecial = isSpecial;
	}
}
